
package ch.hearc.coursJava.kitBase.exerciceTri.list;

import java.util.Comparator;

public class ComparatorComplex implements Comparator<Complexe>
	{

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	@Override
	public int compare(Complexe c1, Complexe c2)
		{
		double module1 = c1.module();
		double module2 = c2.module();

		if (module1 < module2)
			{
			return -1;
			}
		else if (module1 > module2)
			{
			return 1;
			}
		else
			{
			return 0;
			}
		}

	/*------------------------------*\
	|*				Set				*|
	\*------------------------------*/

	/*------------------------------*\
	|*				Get				*|
	\*------------------------------*/

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/
	}
